import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class GeneratePassword {
    public static void main(String[] args) {
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        String rawPassword = "123456";
        String hashedPassword = encoder.encode(rawPassword);
        
        System.out.println("原密码: " + rawPassword);
        System.out.println("BCrypt哈希: " + hashedPassword);
        System.out.println("验证结果: " + encoder.matches(rawPassword, hashedPassword));
    }
}